﻿<UserControl
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:Microsoft.FamilyShow" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2006" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    mc:Ignorable="d" 
    xmlns:properties="clr-namespace:Microsoft.FamilyShow.Properties"
    Width="Auto"
    MinWidth="560"
    x:Class="Microsoft.FamilyShow.Statistics" 
    >

    <StackPanel Width="Auto" MaxWidth="850">

        <!-- Header -->
        <Border Padding="5,0,5,0" Background="{DynamicResource BackgroundBrush}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1,1,1,0" CornerRadius="5,5,0,0" Height="30">
            <Grid>
                <TextBlock Padding="25,0,0,0" Text="{x:Static properties:Resources.Statistics}" TextWrapping="Wrap" Foreground="{DynamicResource HeaderFontColor}" FontSize="18" FontWeight="Bold" d:LayoutOverrides="Height" VerticalAlignment="Center"/>
                <Image HorizontalAlignment="Left" Source="..\Images\Statistics.png"  Height="20" />
                <Button Content="X" x:Name="CloseButton" Click="CloseButton_Click"  Height="15"  HorizontalAlignment="Right" Width="15" Style="{DynamicResource RedButtonStyle}"/>
                <Button Content="{x:Static properties:Resources.PrintMenu}" x:Name="PrintButton" Click="PrintButton_Click"  Height="15"  HorizontalAlignment="Right" Margin="0,0,20,0" MinWidth="65" Style="{DynamicResource RedButtonStyle}"/>
            </Grid>
        </Border>

        <Border x:Name="StatisticsPanel" Background="{DynamicResource PanelGradientBrush}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1,1,1,1">
            <Grid Width="Auto">
                
                <Grid.RowDefinitions>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                </Grid.RowDefinitions>

                <!-- Content -->
                <Border Grid.Row="0" Margin="0,5,0,0">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="2*"/>
                            <ColumnDefinition Width="2*"/>
                            <ColumnDefinition Width="4*"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock  Padding="5,0,0,0" Grid.Column="0" Text="{x:Static properties:Resources.GenderDistributions}" Foreground="{DynamicResource FontColor}" FontWeight="Bold"/>
                    <TextBlock  Padding="0,0,0,0" Grid.Column="1" Text="{x:Static properties:Resources.LivingStatus}" Foreground="{DynamicResource FontColor}" FontWeight="Bold"/>
                    <TextBlock  Padding="0,0,0,0" Grid.Column="3" Text="{x:Static properties:Resources.AgeDistributions}" Foreground="{DynamicResource FontColor}" FontWeight="Bold"/>
                </Grid>
                </Border>

                <Border Margin="5,5,5,5" Grid.Row="1">
                    <Grid >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="2*"/>
                            <ColumnDefinition Width="2*"/>
                            <ColumnDefinition Width="4*"/>
                        </Grid.ColumnDefinitions>

                        <local:Histogram x:Name="GenderDistributionControl" HorizontalAlignment="Left"
				        Foreground="{DynamicResource FontColor}"             
				        CategoryStroke="{DynamicResource CategoryStrokeBrush}"
				        CategoryFill="{DynamicResource FamilyEditListViewSelectedBrush}"
				        SelectedBrush="Transparent"
				        DisabledForegroundBrush="{DynamicResource DisabledForegroundBrush}"
				        AxisBrush="{DynamicResource AxisBrush}" 
                        Grid.Column="0"
                        VerticalAlignment="Bottom"
                        MinHeight="115"
                        MaxHeight="115" />

                        <local:Histogram x:Name="LivingDistributionControl" HorizontalAlignment="Left"
				        Foreground="{DynamicResource FontColor}"
				        CategoryStroke="{DynamicResource CategoryStrokeBrush}"
				        CategoryFill="{DynamicResource FamilyEditListViewSelectedBrush}"
				        SelectedBrush="Transparent"
				        DisabledForegroundBrush="{DynamicResource DisabledForegroundBrush}"
				        AxisBrush="{DynamicResource AxisBrush}" 
                        Grid.Column="1"
                        VerticalAlignment="Bottom"
                        MinHeight="115"
                        MaxHeight="115" />

                        <local:Histogram x:Name="AgeDistributionControl" HorizontalAlignment="Left"             
				        Foreground="{DynamicResource FontColor}"
				        CategoryStroke="{DynamicResource CategoryStrokeBrush}"
				        CategoryFill="{DynamicResource FamilyEditListViewSelectedBrush}"
				        SelectedBrush="Transparent"
				        DisabledForegroundBrush="{DynamicResource DisabledForegroundBrush}"
				        AxisBrush="{DynamicResource AxisBrush}" 
                        Grid.Column="3"
                        VerticalAlignment="Bottom"                 
                        MinHeight="115"
                        MaxHeight="115" />

                    </Grid>
                </Border>
                
                <Border Margin="5,5,5,5" Grid.Row="3">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="2*"/>
                            <ColumnDefinition Width="4*"/>
                            <ColumnDefinition Width="2*"/>
                        </Grid.ColumnDefinitions>

                        <Grid.RowDefinitions>
                            <RowDefinition></RowDefinition>
                            <RowDefinition></RowDefinition>
                        </Grid.RowDefinitions>

                        <TextBlock HorizontalAlignment="Left" Grid.Row="0" Padding="0,0,0,2" Grid.Column="0" Text="{x:Static properties:Resources.SummaryOfEvents}" Foreground="{DynamicResource FontColor}" FontWeight="Bold" TextTrimming="CharacterEllipsis"/>
                    <TextBlock HorizontalAlignment="Left" Grid.Row="0" Padding="5,0,0,2" Grid.Column="1" Text="{x:Static properties:Resources.SummaryOfNames}" Foreground="{DynamicResource FontColor}" FontWeight="Bold" TextTrimming="CharacterEllipsis"/>
                    <TextBlock HorizontalAlignment="Left" Grid.Row="0" Padding="5,0,0,2" Grid.Column="2" Text="{x:Static properties:Resources.SummaryOfMedia}" Foreground="{DynamicResource FontColor}" FontWeight="Bold" TextTrimming="CharacterEllipsis"/>

                        <TextBlock Margin="0,0,0,0" Grid.Row="1" Foreground="{DynamicResource FontColor}" x:Name="MinYear" Text="Earliest known event:"/>
                        <TextBlock Margin="0,18,0,0" Grid.Row="1" Foreground="{DynamicResource FontColor}" x:Name="MaxYear" Text="Latest known event:"/>
                        <TextBlock Margin="0,36,0,0" Grid.Row="1" Foreground="{DynamicResource FontColor}" x:Name="Marriages" Text="Marriages:"/>
                        <TextBlock Margin="0,54,0,0" Grid.Row="1" Foreground="{DynamicResource FontColor}" x:Name="Divorces" Text="Divorces:"/>
                        <TextBlock Margin="0,72,0,0" Grid.Row="1" Foreground="{DynamicResource FontColor}" x:Name="TotalFactsEvents" Text="Facts/Events:"/>
                        <TextBlock Margin="0,90,0,0" Grid.Row="1" Foreground="{DynamicResource FontColor}" x:Name="Relationships" Text="Relationships:"/>
                    
                        <TextBlock Margin="5,0,0,0" Grid.Row="1" Foreground="{DynamicResource FontColor}"  Grid.Column="1" x:Name="FemaleNames" Text="Top girls names:" ToolTip="{x:Static properties:Resources.Tiebreak}"/>
                        <TextBlock Margin="5,36,0,0" Grid.Row="1" Foreground="{DynamicResource FontColor}" Grid.Column="1" x:Name="MaleNames" Text="Top boys names:" ToolTip="{x:Static properties:Resources.Tiebreak}"/>
                        <TextBlock Margin="5,72,0,0" Grid.Row="1" Foreground="{DynamicResource FontColor}" Grid.Column="1" x:Name="Surnames" Text="Top surnames:" ToolTip="{x:Static properties:Resources.Tiebreak}"/>
                    
                    <Border Grid.Column="2" Grid.Row="1" Padding="5,0,0,0">
                       
                    <Grid>

                            <Image Margin="0,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Source="..\Images\Photo.png" Width="16" Height="16" />
                            <TextBlock Margin="20,0,0,0" Foreground="{DynamicResource FontColor}" x:Name="Photos" Text="Photos:"/>
                            
                            <Image Margin="0,18,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Source="..\Images\Note.png" Width="16" Height="16" />
                            <TextBlock Margin="20,18,0,0" Foreground="{DynamicResource FontColor}" x:Name="Notes" Text="Notes:"/>
                            
                            <Image Margin="0,36,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Source="..\Images\paperclip.png" Width="16" Height="16" />           
                            <TextBlock Margin="20,36,0,0" Foreground="{DynamicResource FontColor}" x:Name="Attachments" Text="Attachments:"/>
                            
                            <Image Margin="0,54,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Source="..\Images\Citation.png" Width="16" Height="16" />           
                            <TextBlock Margin="20,54,0,0" Foreground="{DynamicResource FontColor}" x:Name="Citations" Text="Citations:"/>
                            
                            <Image Margin="0,72,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Source="..\Images\Source.png" Width="16" Height="16" />           
                            <TextBlock Margin="20,72,0,0" Foreground="{DynamicResource FontColor}" x:Name="Sources" Text="Sources:"/>
                            
                            <Image Margin="0,90,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Source="..\Images\Repository.png" Width="16" Height="16" />           
                            <TextBlock Margin="20,90,0,0" Foreground="{DynamicResource FontColor}" x:Name="Repositories" Text="Repositories:"/>
                         
                    </Grid>   
                    </Border>
                    
                </Grid>
  
                </Border>
                
                <Border Grid.Row="4">
                    <Grid>

                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="20"/>
                            <RowDefinition Height="20"/>
                            <RowDefinition Height="20"/>

                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>

                        
                        
                        <TextBlock HorizontalAlignment="Left" Grid.ColumnSpan="2"  Padding="5,0,0,2" Grid.Column="0" Text="{x:Static properties:Resources.SummaryOfData}" Foreground="{DynamicResource FontColor}" FontWeight="Bold"/>
   
                        <TextBlock VerticalAlignment="Center" Grid.Column="0" Margin="5,0,5,0" Grid.Row="1" Foreground="{DynamicResource FontColor}" Text="{x:Static properties:Resources.DataQualityColon}"/>
                        <Path x:Name="star1" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Left" Margin="0,0,0,0" VerticalAlignment="Center" StrokeThickness="1" Stroke="#ffffffff" StrokeMiterLimit="1.000000" Fill="{DynamicResource PrimaryStarBrush}" Data="F1 M 9.816406,1.694336 L 12.351074,6.830078 L 18.018066,7.654297 L 13.918457,11.654297 L 14.886230,17.299805 L 9.816406,14.630859 L 4.746094,17.299805 L 5.713867,11.654297 L 1.611328,7.654297 L 7.281250,6.830078 L 9.816406,1.694336 Z" />
                        <Path x:Name="star2" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Left" Margin="20,0,0,0" VerticalAlignment="Center" StrokeThickness="1" Stroke="#ffffffff" StrokeMiterLimit="1.000000" Fill="{DynamicResource PrimaryStarBrush}" Data="F1 M 9.816406,1.694336 L 12.351074,6.830078 L 18.018066,7.654297 L 13.918457,11.654297 L 14.886230,17.299805 L 9.816406,14.630859 L 4.746094,17.299805 L 5.713867,11.654297 L 1.611328,7.654297 L 7.281250,6.830078 L 9.816406,1.694336 Z" />
                        <Path x:Name="star3" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Left" Margin="40,0,0,0" VerticalAlignment="Center" StrokeThickness="1" Stroke="#ffffffff" StrokeMiterLimit="1.000000" Fill="{DynamicResource PrimaryStarBrush}" Data="F1 M 9.816406,1.694336 L 12.351074,6.830078 L 18.018066,7.654297 L 13.918457,11.654297 L 14.886230,17.299805 L 9.816406,14.630859 L 4.746094,17.299805 L 5.713867,11.654297 L 1.611328,7.654297 L 7.281250,6.830078 L 9.816406,1.694336 Z" />
                        <Path x:Name="star4" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Left" Margin="60,0,0,0" VerticalAlignment="Center" StrokeThickness="1" Stroke="#ffffffff" StrokeMiterLimit="1.000000" Fill="{DynamicResource PrimaryStarBrush}" Data="F1 M 9.816406,1.694336 L 12.351074,6.830078 L 18.018066,7.654297 L 13.918457,11.654297 L 14.886230,17.299805 L 9.816406,14.630859 L 4.746094,17.299805 L 5.713867,11.654297 L 1.611328,7.654297 L 7.281250,6.830078 L 9.816406,1.694336 Z" />
                        <Path x:Name="star5" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Left" Margin="80,0,0,0" VerticalAlignment="Center" StrokeThickness="1" Stroke="#ffffffff" StrokeMiterLimit="1.000000" Fill="{DynamicResource PrimaryStarBrush}" Data="F1 M 9.816406,1.694336 L 12.351074,6.830078 L 18.018066,7.654297 L 13.918457,11.654297 L 14.886230,17.299805 L 9.816406,14.630859 L 4.746094,17.299805 L 5.713867,11.654297 L 1.611328,7.654297 L 7.281250,6.830078 L 9.816406,1.694336 Z" />
                        
                        <TextBlock VerticalAlignment="Center"  Grid.Column="0" Grid.Row="2" Margin="5,0,0,0" Foreground="{DynamicResource FontColor}" Text="{x:Static properties:Resources.DataStatusColon}"/>
                        <StackPanel Orientation="Horizontal" Grid.Row="2" Grid.Column="1">
                        <ProgressBar x:Name="FileProgressBar" HorizontalAlignment="Left" VerticalAlignment="Center"  Grid.Row="2" Height="15" Width="100" Margin="0,0,10,0" />
                        <TextBlock x:Name="FileProgressText" VerticalAlignment="Center"  Grid.Row="2" Margin="0,0,0,0" Foreground="{DynamicResource FontColor}" Text="%"/>
                        </StackPanel>
                        <TextBlock Grid.Row="3" Grid.ColumnSpan="2" Height="20" x:Name="DataSize" VerticalAlignment="Center" Margin="5,0,0,0" Foreground="{DynamicResource FontColor}" Text="Data Size:"/>                    
                    </Grid>
                </Border>
            </Grid>
        </Border>

        <!-- Footer -->
        <Border Background="{DynamicResource BackgroundBrush}" Height="15" Width="Auto" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1,0,1,1" CornerRadius="0,0,5,5"/>

    </StackPanel>
</UserControl>
